unit SmallStruct.ActionView.TSSActionButton;

interface

uses
  Windows,
  Messages,
  SysUtils,
  Variants,
  Classes,
  Graphics,
  Controls,
  Forms,
  SmallStruct.Form.TSSFrame,
  RzBmpBtn,
  SmallStruct.Core,
  SmallStruct.Core.TSSObjectContext,
  SmallStruct.ActionView,
  SmallStruct.Core.TSSRuntimeObject,
  SmallStruct.Core.TSSObject,
  ExtCtrls,
  RzPanel;

type
  TSSActionButton = class(TSSFrame, ISSActionButton)
    _Panel: TRzPanel;
    _Button: TRzBmpButton;
  private
    _ActionName: string;
  public
    function GetActionName: string;
    function GetActionCaption: string;
    procedure SetClickEvent(AEvent: TNotifyEvent);
    procedure SetActionName(const AActionName: string);
    procedure SetActionCaption(const AActionCaption: string);
  public
    constructor Create(AOwner: TComponent); override;
  end;

implementation

{$R *.dfm}

{ TSSActionButton }

constructor TSSActionButton.Create(AOwner: TComponent);
begin
  inherited;
  Name := '';
end;

function TSSActionButton.GetActionCaption: string;
begin
  Result := _Button.Caption;
end;

function TSSActionButton.GetActionName: string;
begin
  Result := _ActionName;
end;

procedure TSSActionButton.SetActionCaption(const AActionCaption: string);
begin
  _Button.Caption := AActionCaption;
end;

procedure TSSActionButton.SetActionName(const AActionName: string);
begin
  _ActionName := AActionName;
end;

procedure TSSActionButton.SetClickEvent(AEvent: TNotifyEvent);
begin
  _Button.OnClick := AEvent;
end;

end.
